home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeed.internetmci.com!panix!usenet
- From: gugu@panix.com (Dae Choi)
- Newsgroups: comp.lang.c++
- Subject: Re: Does gcc support template?
- Date: 12 Mar 1996 19:37:54 GMT
- Organization: PANIX Public Access Internet and Unix, NYC
- Message-ID: <1869.6645T885T1536@panix.com>
- References: <3145CC6F.4821@babbage.cs.qc.edu>
- NNTP-Posting-Host: gugu.dialup.access.net
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
-
- Hi Chris,
-
- >Dae Choi wrote:
- >>
- >> Hi everyone. I've been desperately trying to compile the following
- >> program to test template but the compiler would give error messages:
-
- > ...
-
- >> 106 % g++ temp_avg.cc
- >> ld: Undefined symbol
- >> _average_value__FPfi
- >> _average_value__FPii
- >> collect2: ld returned 2 exit status
- >> 107 %
- >>
- >> -----------------------------------------------------------------------
- >>
- >> What does this mean? How can I fix this problem?
- >>
- > It's a problem with your g++ installation. I copied your
- > code into a file on my Solaris 2.3 machine running g++
- > 2.7.2 and got this:
-
- >vickery@babbage[work]> g++ temp_avg.cc
- >vickery@babbage[work]> a.out
- >Average of integer value is 3
- >Average of floating value is 3.3
- >vickery@babbage[work]> g++ -v
- > gcc -v
- >Reading specs from /opt/gnu/lib/gcc-lib/sparc-sun-solaris2.3/2.7.2/specs
- >gcc version 2.7.2
-
-
- I tried on two different different machines:
-
- 54 % g++ temp_avg.cc
- ld: Undefined symbol
- _average_value__FPfi
- _average_value__FPii
- collect2: ld returned 2 exit status
-
- 55 % g++ -v
- gcc -v
- Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/2.5.8/specs
- gcc version 2.5.8
- 56 %
- ---------------------------------------------------------------------------
- 50 % g++ temp_avg.cc Undefined first referenced
- symbol in file
- average_value__FPfi /usr/tmp/cca003UE1.o
- average_value__FPii /usr/tmp/cca003UE1.o
- ld: fatal: Symbol referencing errors. No output written to a.out
- 51 % g++ -v
- /opt/gnu/bin/gcc -v
- Reading specs from /opt/gnu/lib/gcc-lib/sparc-sun-solaris2.3/2.5.8/specs
- gcc version 2.5.8
- 52 %
-
-
- Could it be that gcc version 2.5.8 doesn't support template? But it's a
- relief to know that the code works on some machines... ;^)
-
- Thanks,
-
- Dae Choi
- gugu@panix.com
-
-